import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import Dashboard from '../components/Dashboard.vue'
import OnlineSemrush from '../components/OnlineSemrush.vue'

const routes: RouteRecordRaw[] = [
  { path: '/', name: 'home', component: Dashboard },
  { path: '/online_semrush', name: 'online_semrush', component: OnlineSemrush },
]

const router = createRouter({
  // 使用 Hash 路由，避免生产环境缺少历史路由重写导致空白页
  history: createWebHashHistory(),
  routes,
})

export default router
